<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>
<%@ page import="java.net.*" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	UserBean user = (UserBean)request.getSession().getAttribute("userBean");
	
	String _db = user.getDbType();
	Map<String,List<Map<String, String>>> dicMap = user.getDicMap();
	List<Map<String, String>> list = null;
	String temp = "";
	
	String orgId = request.getParameter("org_id");
	//String orgName = request.getParameter("org_name");
	String orgName = URLDecoder.decode(request.getParameter("org_name"),"UTF-8");
	int columnNum = Integer.parseInt(request.getParameter("column"));
	int type = Integer.parseInt(request.getParameter("type"));
	int year = Integer.parseInt(request.getParameter("year"));
	int quarter = Integer.parseInt(request.getParameter("quarter"));
	int shangbao = Integer.parseInt(request.getParameter("shangbao"));
	int baobiao = request.getParameter("baobiao") == null ? 1 : Integer.parseInt(request.getParameter("baobiao"));
	//baobiao = 1;
	String column = "";
	String columnName = "";
	String title = "";
	if(baobiao == 1){
		switch(columnNum){
			case 30: column = "reserve1"; columnName = "怀孕男职工家庭";break;
			case 31: column = "e_dyrs"; columnName = "怀孕女职工家庭";break;
			case 32: column = "reserve2"; columnName = "等孕男职工家庭";break;
			case 33: column = "e_dyrs"; columnName = "等孕女职工家庭";break;
			case 34: column = "e_bjcs"; columnName = "本季度出生家庭";break;
		}
	}else{
		switch(columnNum){
			case 3: column = "e_zgrs_hj"; columnName = "全部职工";break;
			case 4: column = "e_zgrs_nan"; columnName = "男职工";break;
			case 5: column = "e_zgrs_nv"; columnName = "女职工";break;
			case 6: column = "e_hyzk_jhrs"; columnName = "结婚人数";break;
			case 7: column = "e_hyzk_whrs"; columnName = "晚婚人数";break;
			
			case 9: column = "e_syqk_csyes"; columnName = "出生婴儿数";break;
			case 10: column = "e_syqk_qz_jhnyt"; columnName = "计划内一胎";break;
			case 11: column = "e_syqk_qz_jhnet"; columnName = "计划内二胎";break;
			//case 12: column = "e_syqk_qz_jhwcs"; columnName = "计划外出生";break;
			case 13: column = "e_syqk_qz_wyrs"; columnName = "晚育人数";break;
			case 16: column = "e_syqk_qz_hyrs"; columnName = "怀孕人数";break;
			case 17: column = "e_dsznqk_yingbanzheng"; columnName = "应办证职工";break;
			case 18: column = "e_dsznqk_yibanzheng"; columnName = "已办证职工";break;
			
			case 20: column = "e_dsznqk_xydszns"; columnName = "现有独生子女数";break;
			
			case 21: column = "e_ssqk_rl"; columnName = "四书情况-人流";break;
			case 22: column = "e_ssqk_sh"; columnName = "四书情况-上环";break;
			case 23: column = "e_ssqk_jz"; columnName = "四书情况-结扎";break;
			case 24: column = "e_ssqk_yc_zq"; columnName = "四书情况-引产-中期";break;
			case 25: column = "e_ssqk_yc_dyf"; columnName = "四书情况-引产-大月份";break;
			
			case 26: column = "e_blzsyzms"; columnName = "办理再生育证明数";break;
		}
	}
	
		
	if(type == 1){
		title = orgName + " " + year + "年第" + quarter + "季度" + columnName;
	}else{
		title = orgName + " " + year + "年" + columnName;
	}

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title><%=title %></title>
		<base href="<%=basePath%>"/>
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />

		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/validata.js"></script>

		<script type="text/javascript" src="ligerUI/js/plugins/ligerGrid.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerTree.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerForm.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerDateEditor.js"></script>
		
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.validate.min.js" ></script> 
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.metadata.js"></script>
		<script type="text/javascript" src="ligerUI/jquery-validation/messages_cn.js" ></script>
		
<script type="text/javascript">
var _db = '<%=_db%>';

_jsonObj.classname = "com.wxtf.platform.main.tjbb.Baobiao<%=baobiao%>Action";
_jsonObj.methodname = "queryEmployeeFamily";
_jsonObj.logicdata = "[{\"types\":\"init\",\"type\":\"<%=type%>\",\"org_id\":\"<%=orgId%>\",\"column\":\"<%=columnNum%>\",\"year\":\"<%=year%>\",\"quarter\":\"<%=quarter%>\",\"shangbao\":\"<%=shangbao%>\"}]";

$(function(){
	validEvent("emp-form");
	
	grid1 = $("#emp-grid").ligerGrid({
		url: _url, parms: _jsonObj, width: '100%', height: '100%',
		usePager: true, rownumbers: true, checkbox: false, alternatingRow: true,
		columns: [
			{ display: 'tbe_id', name: 'tbe_id', hide: true,width:1 },
			{ display: 'org_id', name: 'org_id', hide: true,width:1 },
			{ display: '机构名称', name: 'org_name', width:150, align:'left' },
			{ display: '职工证号', name: 'tbe_work_permit', width: 100, align: 'left' },
			{ display: '姓名', name: 'tbe_name', width: 100, align: 'left' },
			{ display: '性别', name: 'tbe_sex', width: 60, align: 'left' },
			{ display: '年龄', name: 'tbe_age', width: 1, hide:true },
			{ display: '出生日期', name: 'tbe_birthday', width: 100, align: 'left' },
			{ display: '身份证号', name: 'tbe_idcard', width: 180, align: 'left' },
			{ display: '配偶姓名', name: 'tbfi_spouse_name',width: 100, align: 'left'},
			{ display: '配偶年龄', name: 'tbfi_spouse_age',width: 1, hide:true},
			{ display: '配偶性别', name: 'tbfi_spouse_sex',width: 100, align: 'left'},
			{ display: '配偶出生日期', name: 'tbfi_spouse_birthday',width: 100, align: 'left'},
			{ display: '配偶身份证号', name: 'tbfi_spouse_idcard',width: 100, align: 'left'},
			{ display: '配偶所属单位', name: 'tbfi_spouse_department',width: 100, align: 'left'},
			{ display: '配偶职务', name: 'tbfi_spouse_position',width: 100, align: 'left'},
			{ display: '籍贯', name: 'tbe_native_palce', width: 1, hide:true },
			{ display: '家庭电话', name: 'tbe_family_phone', width: 100, align: 'left' },
			{ display: '家庭住址', name: 'tbe_address', width: 250, align: 'left' },
			{ display: '家庭人数', name: 'tbfi_peo_num',width: 100, align: 'left' },
			{ display: '家庭子女数', name: 'tbfi_children_num',width: 100, align: 'left'  },
			{ display: '男孩数', name: 'tbfi_children_mnum',width: 100, align: 'left'  },
			{ display: '女孩数', name: 'tbfi_children_fnum',width: 100, align: 'left' },
			{ display: '员工状态', name: 'tbe_status', width: 100, align: 'left',
				render: function(record, index, value, oth){
					<%
					list = dicMap.get("102");
					temp = "";
					if(null != list && list.size() > 0){
						for(Map<String, String> map: list){
					%>
					if(value == '<%=map.get("tmgd_id")%>'){
						<%temp = map.get("tmgd_name");%>
						return '<%=temp%>';
					}
					<%
						}
					}
					%>
					return value;
				}
			},
			{ display: '婚姻状态', name: 'tbe_marital_status', width: 100, align: 'left',
				render: function(record, index, value, oth){
					<%
					list = dicMap.get("27");
					temp = "";
					if(null != list && list.size() > 0){
						for(Map<String, String> map: list){
					%>
					if(value == '<%=map.get("tmgd_id")%>'){
						<%temp = map.get("tmgd_name");%>
						return '<%=temp%>';
					}
					<%
						}
					}
					%>
					return value;
				}
			},
			{ display: '婚姻状况', name: 'tbe_marital_condition', width: 1, hide:true },
			{ display: '是否允许再生育', name: 'tbe_is_again_birth',width: 1, hide:true,
				render: function(record, index, value, oth){ return value == '1' ? '是' : '否'; }
			},
			{ display: '是否不孕症（绝经）', name: 'tbe_is_barrenness', width: 1, hide:true,
				render: function(record, index, value, oth){ return value == '1' ? '是' : '否'; }
			},
			{ display: '是否晚婚', name: 'tbe_is_late_marriage',width: 1, hide:true,
				render: function(record, index, value, oth){ return value == '1' ? '是' : '否'; }
			},
			{ display: '是否晚育', name: 'tbe_is_late_birth', width: 1, hide:true,
				render: function(record, index, value, oth){ return value == '1' ? '是' : '否'; }
			},
			{ display: '配偶员工id', name: 'tbe_spouse_id', width:  1, hide:true },
			{ display: '配偶是否一汽员工', name: 'tbfi_spouse_is_join', width:  1, hide:true },
			{ display: '家庭电话', name: 'tbfi_phone', width:  1, hide:true },
			{ display: '紧急联系电话', name: 'tbfi_mobile', width:  1, hide:true },
			{ display: '家庭地址', name: 'tbfi_address', width:  1, hide:true },
			{ display: '备注', name: 'tbfi_memo', width:  1, hide:true },
			{ display: 'reserve1', name: 'reserve1', width:  1, hide:true },
			{ display: 'reserve2', name: 'reserve2', width:  1, hide:true },
			{ display: 'reserve3', name: 'reserve3', width:  1, hide:true },
			{ display: 'reserve4', name: 'reserve4', width:  1, hide:true },
			{ display: 'reserve5', name: 'reserve5', width:  1, hide:true },
			{ display: '录入人', name: 'create_by', width:  1, hide:true },
			{ display: '录入时间', name: 'create_time', width:  1, hide:true },
			{ display: '最后修改人', name: 'last_modify_by', width:  1, hide:true },
			{ display: '最后修改时间', name: 'last_modify_time', width: 1, hide:true }
		]
	});

	
	/*
	 * 日期框
	 */
	$("#tbfi_spouse_birthday").ligerDateEditor({ format: "yyyy-MM-dd", width:182 });
	$("#tbfci_birthday").ligerDateEditor({ format: "yyyy-MM-dd", width:182 });
	
});

/*
 * ajax成功回调
 */
function ajaxCallbackSuccFunc(data, textStatus){
	succMsgTip(data.resultrecord);
	serch1();
	if(win && data.result){
		win.hide();
	}
}

/*
 * ajax失败回调
 */
function ajaxCallbackErrorFunc(data, textStatus){
	succMsgTip(data.resultrecord);
}


/*
 * 重置-条件查询
 */
function serReset(){
	$('#ser5').val('0');
	$('#ser3').val('');
	$('#ser1').val('');
	$('#ser2').val('');
	$('#ser4').val('');
}

/*
 * 条件查询
 */
function serch1(){
	var orgIds = $('#org2').val();
	var tbe_employment_forms = $('#ser5').val();
	var tbe_work_permit = $('#ser3').val();
	var tbe_name = $('#ser1').val();
	var tbe_spell_code = $('#ser2').val();
	var tbe_idcard = $('#ser4').val();
	var tbfi_spouse_name = $('#ser7').val();
	var tbfi_spouse_idcard = $('#ser6').val();
	
	_jsonObj.methodname = "queryPage";
	_jsonObj.logicdata = '[{\"orgIds\":\"' + orgIds + '\",\"tbe_employment_forms\":\"' + tbe_employment_forms
			+ '\",\"tbe_work_permit\":\"' + tbe_work_permit + '\",\"tbe_name\":\"' + tbe_name
			+ '\",\"tbe_spell_code\":\"' + tbe_spell_code + '\",\"tbe_idcard\":\"' + tbe_idcard
			+ '\",\"tbfi_spouse_name\":\"' + tbfi_spouse_name + '\",\"tbfi_spouse_idcard\":\"' + tbfi_spouse_idcard
			+ '\",\"types\":\"serch1\"}]';
	grid1.loadData();
}


</script>
	<body>
		<center><h2 style="display:block;padding:10px 0;"><%=title %></h2></center>
		<div id="emp-grid"></div>
		
	</body>
</html>










